﻿<%@ Page Language="C#" MasterPageFile="~/MangerPage.master" AutoEventWireup="true" CodeFile="Manger_ResourceList.aspx.cs" Inherits="Manger_ResourceList" Title="资源列表" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<div class="pagetitle">资源列表</div>
    <asp:XmlDataSource ID="XmlDataSource1" runat="server" DataFile="~/xml/NewsType_000000.xml">
    </asp:XmlDataSource>
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:Jxzy_Database %>"　
        DeleteCommand="DELETE FROM [zyk_Resources] WHERE [Resource_ID] = @Resource_ID" >
       <DeleteParameters>
            <asp:Parameter Name="Resource_ID" Type="Int32" />
        </DeleteParameters>

    </asp:SqlDataSource>
    <br />
    <div style="float:left">
    <asp:TreeView ID="TreeView1" runat="server" DataSourceID="XmlDataSource1"   ShowLines="True" Visible="False" OnSelectedNodeChanged="TreeView1_SelectedNodeChanged">
        <DataBindings>
            <asp:TreeNodeBinding DataMember="siteMapNode" TextField="typename" ValueField="typeid" />
        </DataBindings>
        <ParentNodeStyle Font-Bold="False" />
        <HoverNodeStyle Font-Underline="True" ForeColor="#6666AA" />
        <SelectedNodeStyle BackColor="#C0C0FF" Font-Bold="True" Font-Underline="False" HorizontalPadding="0px"
            VerticalPadding="0px" />
        <NodeStyle Font-Names="Tahoma" Font-Size="8pt" ForeColor="Black" HorizontalPadding="5px"
            NodeSpacing="0px" VerticalPadding="1px" />
    </asp:TreeView>
    </div>
        <div style="float:left">
        <div>
            <asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="资源筛选" />点“资源筛选”按钮可分类查看。关键字：<asp:TextBox
                ID="tbKeyWord" runat="server" Width="136px"></asp:TextBox>
            <asp:Button ID="Button2" runat="server" Text="检索" OnClick="Button2_Click" /></div>
        <div><asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataKeyNames="Resource_ID"  DataSourceID="SqlDataSource1" CssClass="mytable" OnRowDeleted="GridView1_RowDeleted">
            <Columns>
                <asp:TemplateField HeaderText="类别" SortExpression="News_TypeName">
                    <ItemTemplate>
                        <asp:Label ID="Label1" runat="server" Text='<%# Convert.ToString(Eval("Resource_TypeName")).Substring(Convert.ToString(Eval("Resource_TypeName")).LastIndexOf("->") + 2, Convert.ToString(Eval("Resource_TypeName")).Length - Convert.ToString(Eval("Resource_TypeName")).LastIndexOf("->") - 2) %>'></asp:Label>
                    </ItemTemplate>
                    <ItemStyle Width="80px" />
                </asp:TemplateField>
                <asp:BoundField DataField="Resource_AddDate" DataFormatString="{0:yyyy/MM/dd}" HeaderText="日期"
                    SortExpression="Resource_AddDate" HtmlEncode="False" >
                    <ItemStyle Width="90px" />
                </asp:BoundField>
                <asp:HyperLinkField DataTextField="Resource_Name" HeaderText="标题" >
                    <ItemStyle Width="500px" HorizontalAlign="Left" />
                </asp:HyperLinkField>
                <asp:TemplateField HeaderText="操作">
                    <ItemTemplate>
                        &nbsp;<asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl='<%# "Manger_ResourceAdd.aspx?rs_id="+Eval("Resource_ID") %>'>编辑</asp:HyperLink>&nbsp;
                        <asp:LinkButton ID="LinkButton1" runat="server" CommandName="Delete" OnClientClick="return confirm('确定删除么？');">删除</asp:LinkButton>
                    </ItemTemplate>
                    <ItemStyle Width="90px" />
                </asp:TemplateField>
            </Columns>
            <EmptyDataTemplate>
                对不起，没有找到记录！
            </EmptyDataTemplate>
        </asp:GridView>
        </div>
    </div>
</asp:Content>

